<?php
declare (strict_types=1);

namespace app\portal\controller;

use app\BaseController;
use app\model\PortalArticle;
use app\model\PortalMenu;
use http\Env;
use think\Request;

class Lists extends BaseController
{

    public function index(Request $request)
    {
        $tid = $request->param('tid');
        $_G = $request->param();
        $_G['menu'] = PortalMenu::cache()->find($tid);
        $_G['list'] = PortalArticle::where('tid', $tid)->cache(true,600)->paginate(20);
        // 获取分页显示
        $_G['page'] = $_G['list']->render();
        $this->assign('_G', $_G);
        return $this->fetch("/list");
    }


}
